JBoss Fuse Technology Overview

Red Hat JBoss Fuse Integration Partner Day

Charles Moulliard (@cmoulliard)
Architect, Engineer & Committer

13th of May - 2014

Projects timeline

  • A few things about Fuse & OpenSource

HistoryOfFuse

Integration

hub

  • Integration is    really hard

  •    protocols, standards, data formats, systems

  • Long story since Common Object Request Broker Architecture

Common pattern

producer-consumer

  • Decouple Producer from Consumer

  • Message transport information

  • Goal : Isolate applications from each/other, integrate them

Point to Point topology

  • Producer sends messages to a queue (using JMS API).

  • Consumer listens for messages from the queue

  • Messages are stored until read (or expired)

  • Messages can be persisted, are read only once.

point to point

Publish To Subscribe

  • A client sends message to the topic.

  • Broker sends message to all subscribers that are currently alive.

  • Messages are consumed x times (relation 1 to many)

publish subscribe

Technology part of

  • ActiveMQ project High performance, reliable JMS messaging fabric

  • Supporting JMS, C, C++, .Net, Stomp, AMQP clients

  • Protocols : TCP/SSL/HTTP/HTTPS/WebSocket …

broker-architecture

Master/Slave

  • High-Availability / Failover

  • Brokers compete to acquire lock - FS/DB

master-slave

Network of Brokers

  • Forward messages

  • Loadbalancing, isolate brokers - security, …

network-of-broker

JBoss A-MQ

  • An open source messaging platform

rh jboss amq

What about Bus ?

bus1

  •    Complex use cases    correlation, orchestration, routing, mediation, transformation

  •    Layer to exchanges messages    BUS

  •    Ideas Implemented into ESB

ESB & JBI

esb1 esb

  • Services & Components communicate using NMR bus

  • Packaged as zip (=SU) in a big zip (=SA) including xml config, target service

  • Constraint : messages formated as XML

  •    EIP not included in the spec

Camel

camel box small
  • OpenSource Java Integration Framework

  • Designed around : Domain Specific Language

  • Implement Enterprise Integration Patterns

book

Camel - con’t

  • > 50 patterns implemented

  • and more : Loadbalancer, Throttler, Delayer, …

patterns
patterns 3

Camel - con’t

factory

  • Key features

    • Component

    • Endpoint

    • Consumer

    • Producer

Camel - con’t

  • Key features : route, processor

pipeline

Camel - con’t

  • Interceptor : trace, log, capture business events

pipeline2

Camel - con’t

camel-features

  • Container for the routes    CamelContext

Camel - con’t

camel-features2

  • Cross communication not allowed using direct, seda

Camel - con’t

camel-features3

  • But possible Using BUS like NMR, Broker, Shared Component with direct-vm, vm

Camel - con’t

type-converter

  • Type Converter Strategy

  • Allow to convert the body payloads from one type to another

  • To and From these types

    • File

    • String

    • byte[] and ByteBuffer

    • InputStream and OutputStream

    • Reader and Writer

Camel - con’t

  • Data Transformation for complex use case

package org.devnation.camel;

import java.io.InputStream;
import java.io.OutputStream;
import org.apache.camel.Exchange;

public interface DataFormat {

    void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception;

    Object unmarshal(Exchange exchange, InputStream stream) throws Exception;
}
  • Marshalling : Object XML (JAXB)

  • Unmarshalling : XML Object (JAXB)

Camel - con’t

dataformat 2

Camel - con’t

inonly

Camel - con’t

inout

Camel - con’t

  • Fluent API

package org.devnation.camel;

import org.apache.camel.builder.RouteBuilder;

public class ExampleRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {

        from("amq:queue:quotes")
           .filter().xpath("/quote/product/ = 'widget")
                .bean("QuotesService", "widget")
           .filter().xpath("/quote/product/ = 'gadget")
                .bean("QuotesService","gadget");

    }
}

Camel - con’t

  • Alternative : Spring, Blueprint DSL

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    ">
    <bean id="quotesService" class="org.devnation.camel.QuotesService"/>"

    <camelContext  xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="amq:queue:quotes"/>
            <filter>
                <xpath>"/quote/product/ = 'widget"</xpath>
            </filter>
                <bean id="quotesService" method="widget"/>
            <filter>
                <xpath>"/quote/product/ = 'gadget"</xpath>
            </filter>
            <bean id="quotesService" method="gadget"/>
        </route>
    </camelContext>

</beans>

Camel - con’t

  • In memory bus / alternative to JBI, SCA, NMR

  • Transport objects : XML, File, Stream, Bytes

  • Predicate & Expression language (xslt, xpath, …)

  • Sync/Async exchanges

  • Threads Management,

  • Tx Architecture

  • Error and exception handling

  • Policy driven

  • Container agnostic

Camel - con’t

components

Factory to build/run SOAP/REST services

  • Apache CXF Simplify creation & deployment of web/REST services

  • 2 approaches “java wsdl” or “wsdl java”

  • Support :

    • JAX-WS : Web Services (XML/SOAP)

    • JAX-RS : REST service (JSON)

    • SOAP 1.1, 1.2, WSDL 1.1, WS-Security, WS-Addressing, WS-RM

fabric cxf

Apache CXF - con’t

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                <wsdlOptions>
                    <wsdlOption>
                        <wsdl>${basedir}/src/main/resources/myService.wsdl</wsdl>
                    </wsdlOption>
                </wsdlOptions>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Apache CXF - con’t

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xmlns:cxf="http://camel.apache.org/schema/cxf"
...

<cxf:cxfEndpoint id="reportIncident"
    address="http://localhost:{{port}}/camel-example/webservices/incident"
    wsdlURL="etc/report_incident.wsdl"
    serviceClass="org.apache.camel.example.ReportIncidentEndpoint"/>
...

<route>
      <from uri="cxf:bean:reportIncident"/>
      <convertBodyTo type="org.apache.camel.example.reportincident.InputReportIncident"/>
      <transform>
        <method bean="responseBean" method="getOK"/>
      </transform>

Integration everywhere

rh jboss fuse
  • Enables integration everywhere for a real-time enterprise

Apache Karaf karaf-logo

  • Java OSGI Runtime

  • Offer modularity for Integration

  • Multi-Technology platform

ship containers

Apache Karaf - con’t

karaf

  • Technology    Camel, CXF, ActiveMQ, Spring, Fabric, …

  • Modular platform (deploy or remove container/libraries)

Apache Karaf - con’t

  • SSH server

  • Allow to administrate/create instances

  • Propose Provisioning solution features

  • Hot deployment

  • Configuration & Instances management

  • Security integration - JAAS

Apache Karaf - con’t

  • Karaf DEMO :

    • Admin

    • Provisioning

    • Hot Deployment

Apache Karaf - con’t

  • Camel routes isolated from each other (classloader)

  • Bundle    CamelContext boundaries    Local BUS

  • Camel routes    can have different SLA (Threads, Policies, …)

karaf1

Apache Karaf - con’t

  • Camel routes can be started/stopped/updated

  •    Simplify maintenance process

karaf2

Apache Karaf - con’t

  • New routes can be hot deployed

  • like also "Beans/POJO, Web Services, …"

karaf3

Integration - con’t

  • How can I manage complex infrastructure (config, ip, …)

  • Combine Local/Remote/Virtual Machines/Iaas/Paas

karaf4

Integration - con’t

  • Can we support other Java containers

  • Web/JavaEE/MicroContainer/Docker …

karaf5

Fabric8

  • Opensource integration project - http://fabric8.io

  • Goals :

    • Configuring, provisioning & running Fuse on any machines physical, virtual, private, public, cloud …

    • Virtualize services (endpoints), processes

    • Propose ElasticSearch Storage engine (insight)

Fabric8 - con’t

fabric-3

  • Karaf can create new instances (locally) & administrate them (locally or remotely)

  

  • Instances are not “cloned”

  • Configurations must be updated (manually)

Fabric8 - con’t

  • Fabric extend the possibilities

fabric-4

Fabric8 - con’t

  • Management rely on    Zookeeper server (ensemble of 1,3, 5 or servers)   

fabric-1

Fabric8 - con’t

& Fabric Agents

fabric-2

  • They will communicate with Zk server to :

   register container info (ports, services, endpoints, processes)

   get their provisioning

Fabric8 - con’t

  • Provisioning = Behavior of a container, achieved with Profiles

  • Enveloppe(s) containing artifacts to be deployed or parameters to be configured

  • Can be versioned, facilitate mngt - rollback

fabric 5

Fabric8 - con’t

  • Virtualization    Create “indirection” points

  • Load balancing and failover

  • Easy elastic scaling of services

  • High-availability, Replication

Fabric8 - con’t

fabric camel

Fabric8 - con’t

fabric activemq

Fabric8 - con’t

  • Insight Technology   

  • NoSQL storage for JSon documents

  • Designed around ElasticSearch

elasticsearch1
float

Fabric8 - con’t

  • Dashboard

kibana3
  • Full Text Search features

lucene logo

Fabric8 - con’t

  • Collect

    • Logs,

    • Camel metrics,

    • JMX metrics,

    • Own data metrics

Fabric8 - insight

400

Fabric8 - insight

80%

Fabric8 - insight

80%

Fabric8 - insight

  • Create a bean recuperating Message/Exchange using @Header, @Body

  • Store it using org.fusesource.insight.storage.StorageService

import org.apache.camel.Header;
import org.fusesource.insight.storage.StorageService;
import java.sql.Timestamp;
import java.util.Date;

public class StoreService {

    private static String ES_TYPE = "insight-tweet";
    private static StorageService storageService;

    public static void store(@Header("tweet-full") String data) {
        storageService.store(ES_TYPE, generateTimeStamp(), data);
    }

Hawtio

hawtio-logo-bigger

  • Lightweight & modular HTML5 web console with plugins for managing Java MBeans

  • Javascript / REST front end    jolokia JMX translator

  • Heart of the new Fuse Management Console

  • 100    100    100    150

Hawtio - con’t

hawtio-1

Hawtio - con’t

hawtio-2

Hawtio - con’t

hawtio-3

Hawtio - con’t

hawtio-4 hawtio-5

Agenda

  • Projects timeline

  • High level presentation

  • Technology overview

  • Architectures design

  • Demos

Messaging

  • The BUS operates the exchanges between the endpoints using Camel (local) or NMR (global)

messaging

Messaging & Java Beans

  • Decoupling "services" from integration layer

messaging java

Messaging & Java & Web

  • Karaf runs Jetty Web Server

  • Web Project can be registered using OSGI HTTP Service

messaging java web

Distributed

distributed

What is different between the 2 products

  • 2 products JBoss Fuse & AMQ

  • Designed around Multi-Technology OSGI Container

  • Packaging of Open Sources projects :

    • Karaf,

    • Camel,

    • Cxf,

    • ActiveMQ,

    • Fabric8,

    • Hawtio

Demos

Apache Karaf

POJO + Messaging + Web

Apache ActiveMQ

High Availability with Network of Brokers

Fabric8

Virtualization of Camel endpoints / loadbalancing

Questions

questions

  • Twitter : @cmoulliard

  • More info   

    • www.jboss.org/products/fuse.html

    • www.redhat.com/products/jbossenterprisemiddleware/fuse/